﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Protoss
{
	public class ActionProduceFleetBeacon : ActionProduceFromProbe
	{
		public static ActionProduceFleetBeacon Instance = new ActionProduceFleetBeacon();

		private ActionProduceFleetBeacon() : base(60, 300, 200) { }

		public override ProtossState.ProtossBuilding GetBuilding(ProtossState state) { return state.FleetBeacon; }
		public override string EventName { get { return "ActionSpawnFleetBeacon"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			ProtossState state = bo.State as ProtossState;
			return state.Stargate.Count > 0;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			ProtossState state = bo.State as ProtossState;
			return base.IsInvalid(bo) || state.Stargate.Total == 0;
		}

		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceStargate.Instance } };
				return m_Requirements;
			}
		}
	}
}
